package com.raising.framework.entity;

/**
 * 错误码
 * @author GaoYuan
 * @date 2018/4/24 上午8:22
 */
public enum ResultCode {
    /** 成功 */
    OK(200, "OK", "操作成功"),
    /** 系统错误 */
    SYSTEM_ERR(500, "System Error", "系统错误"),

    /** 无权操作 */
    NO_PERMISSIONS(30031, "Have no permission", "无权操作"),
    /** 参数不能为空 */
    PARAM_EMPTY(30001, "Param cannot be empty", "参数不能为空"),
    /** 当前数据状态不允许操作 */
    NOT_RIGHT_STATUS(30001, "Current status cannot be operated", "当前状态不允许操作"),
    /** 没有数据记录 */
    RECORD_EMPTY(30012, "Record empty", "没有记录"),
    /** 数据已存在 */
    RECORD_EXIST(30009, "Record exits", "记录已存在"),
    /** 数据重复 */
    RECORD_REPEAT(30001, "Record repeat", "记录重复"),
    /** 登录失败 */
    LOGIN_FAILURE(30001, "login failure", "登录失败");

    private int code;
    private String msg;
    private String desc;

    ResultCode(int code, String msg, String desc) {
        this.code = code;
        this.msg = msg;
        this.desc = desc;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
